package com.xxxx.server.controller;

import com.xxxx.server.pojo.RespBean;
import com.xxxx.server.pojo.SendMail;
import com.xxxx.server.service.ISendMailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "发送邮件",tags = "发送邮件")
@RestController
@RequestMapping("/system/sendEmail")
public class SendEmail {

    @Autowired
    private ISendMailService sendMailService;
    @ApiOperation(value = "发送邮件")
    @PostMapping("/postMail")
    public RespBean sendMail(SendMail sendMail)
    {
        if(sendMailService.sendMail(sendMail))
        {
            return RespBean.success("发送成功");
        }
return RespBean.error("发送失败");
    }
}
